package expression;

import cn.hutool.core.util.NumberUtil;

/**
 * @author jukg
 * @date 2023/04/12 19:58
 * @description
 */
public class Expression {

    public static void main(String[] args) {
        /*String expression = "5/6";
        double result = Calculator.conversion(expression);
        System.out.println(expression + " = " + result);
        System.out.println();

        expression = "20/6";
        result = Calculator.conversion(expression);
        System.out.println(expression + " = " + result);
        System.out.println();*/
        System.out.println(getTotal("5/6*100"));

    }

    public static String getTotal(String expression){
        double result = Calculator.conversion(expression);
        if(Double.isNaN(result)){
            return "0";
        }
        return  NumberUtil.round(result, 2).toString();
    }
}
